<!-- 缺省页 -->
<template>
    <div class="empty">
        <van-icon
            name="arrow-left"
            color="#fff"
            @click="closeWebView"
            size="20" />
        <div class="flex-col-start">
            <van-image
                fit="cover"
                class="icon" />
            <div class="text">
                {{ t('moviesTribe.ThePageHasExpired') }}
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
    import { closeWebview, reportEvent } from '@/utils/NativeUtils';
    import { useRouter } from 'vue-router';
    import { useI18n } from 'vue-i18n';

    const { t } = useI18n();
    const router = useRouter();
    function closeWebView() {
        if (!closeWebview()) {
            if (window.history.state.position > 0) {
                router.go(-1);
            } else {
                router.replace('/');
            }
        } else {
            closeWebview();
        }
        reportEvent('影视部落', '缺省页', '返回');
    }
</script>
<style lang="scss" scoped>
    .empty {
        padding: 50px 20px 0px;
        width: 100vw;
        height: 100vh;
        background: #000000;

        .icon {
            margin-top: 226px;
            width: 144px;
            height: 144px;
        }
        .text {
            margin-top: 16px;
            font-weight: 400;
            font-size: 28px;
            line-height: 18px;
            text-align: center;
            color: rgba(255, 255, 255, 0.6);
        }
    }
</style>
